//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package messages;

import common.AdvertisementEntry;
import common.ByteStream;

import java.util.ArrayList;
import java.util.List;

public class AdvertisementList extends Base {
    public static final int MsgType = 24110;
    public List<AdvertisementEntry> newspaper;

    public AdvertisementList() {
        super(24110);
    }

    public void encode(ByteStream stream) {
    }

    public void decode(ByteStream stream) {
        int size = stream.readInt();
        if(size > 0) {
            this.newspaper = new ArrayList(size);

            for(int i = 0; i < size; ++i) {
                AdvertisementEntry ae = new AdvertisementEntry();
                ae.decode(stream);
                this.newspaper.add(ae);
            }
        }

        this.isDecoded = true;
    }
}
